﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using ViCode_LeVi.Data;
using ViCode_LeVi.Reports;

using System.IO;
using ColorPicker;
using System.Runtime.InteropServices;
using System.ComponentModel;
using ViCode_LeVi.Controls.BTBData;

namespace ViCode_LeVi.Controls
{
    /// <summary>
    /// Interaction logic for VMTabImages.xaml
    /// </summary>
    public partial class VMTabTextBoxFormatInfo : System.Windows.Controls.UserControl
    {
        public VMTabTextBoxFormatInfo()
        {
            InitializeComponent();
            SetUpEvent();
        }
        FontHeight fontSizeList = new FontHeight();
        FontList fontTypeTist = new FontList();
       // VMTextBoxFormatInfo _VMTextBoxFormatInfo = new VMTextBoxFormatInfo();
       void SetUpEvent()
       {
           //_VMTextBoxFormatInfo = new VMTextBoxFormatInfo();
           ComboBox_FontSize.ItemsSource = fontSizeList;
           ComboBox_FontType.ItemsSource = fontTypeTist;
           this.DataContext = VMTextBoxFormatInfo.Intance;
           VMTextBoxFormatInfo.Action_IntanceChanged = () =>
               {
                   this.DataContext = VMTextBoxFormatInfo.Intance;
               };
       }
        
        private void ToolStripButtonTextcolor_Click(object sender, RoutedEventArgs e)
        {
            ColorDialog colorDialog = new ColorDialog();
           
            if ((bool)colorDialog.ShowDialog())
            {

                VMTextBoxFormatInfo.Intance.ForeColor = new SolidColorBrush(colorDialog.SelectedColor);
            }
        }

        
        private void ToolStripButtonBackcolor_Click(object sender, RoutedEventArgs e)
        {
            ColorDialog colorDialog = new ColorDialog();          
            if ((bool)colorDialog.ShowDialog())
            {
                VMTextBoxFormatInfo.Intance.Background = new SolidColorBrush(colorDialog.SelectedColor);
            }
        }
        private void ToolStripButtonBold_Click(object sender, RoutedEventArgs e)
        {
            //VMTextBoxFormatInfo.Intance.IsBold == !VMTextBoxFormatInfo.Intance.IsBold;
            //if (VMTextBoxFormatInfo.Intance.IsBold == true)
            //{
            //    VMTextBoxFormatInfo.Intance.IsBold = false;
            //}
            //else
            //{
            //    VMTextBoxFormatInfo.Intance.IsBold = true;
            //}

        }
       

        //private void button_thu_Click(object sender, RoutedEventArgs e)
        //{
        //    string s = string.Format("I: {0}, B: {1} , U : {2}, Nen: {3} Mau Chu {4}, Font {5} Size : {6}", _VMTextBoxFormatInfo.IsItalic,_VMTextBoxFormatInfo.IsBold, _VMTextBoxFormatInfo.IsUnder,
        //        VMTextBoxFormatInfo.Intance.Background.ToString(), _VMTextBoxFormatInfo.ForeColor.ToString(), _VMTextBoxFormatInfo.FontText.ToString(), _VMTextBoxFormatInfo.dFontSize);
        //    MessageBox.Show(s);
        //}

    }
}
